package com.ylxn.codeTop;

/**
 * @author cenghaile
 * @version 1.0.0
 * @titel Fib
 * @description <TODO description class purpose>
 * @crete 2023/5/26 09:24
 */
public class Fib {

    

    public static int fib(int n) {
        int a = 0, b = 1, sum;
        for(int i = 0; i < n; i++){
            sum = (a + b) % 1000000007;
            a = b;
            b = sum;
        }
        return a;
    }
}
